package com.ruoyi.app.controller;

import com.ruoyi.app.domain.AppUsers;
import com.ruoyi.app.service.IAppUsersService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
//刘嘉特
@RestController
@RequestMapping("/app/users/test/test")
public class AppBase10Controller extends BaseController {
    @Autowired
    private IAppUsersService appUsersService;
    @GetMapping("/listAllUser")
    public TableDataInfo list(AppUsers appUsers)
    {
        startPage();
        List<AppUsers> list = appUsersService.selectAppUsersList(appUsers);
        return getDataTable(list);
    }
    @PostMapping("/register")
    public AjaxResult add(@RequestBody AppUsers appUsers)
    {
        return toAjax(appUsersService.insertAppUsers(appUsers));
    }

    @PutMapping("/update")
    public AjaxResult edit(@RequestBody AppUsers appUsers)
    {
        return toAjax(appUsersService.updateAppUsers(appUsers));
    }

}